const fs = require("fs");
const path = require("path");

function main() {
  // 定义要生成的数据
  const versionData = {
    code: 200,
    msg: "成功",
    data: {
      version: new Date().getTime(),
      force: false,
    },
  };

  // 将数据转换为 JSON 格式
  const versionJson = JSON.stringify(versionData, null, 2);

  // 写入文件到 public/version.js
  const outputPath = path.resolve(__dirname, "./public/version.json");
  fs.writeFileSync(outputPath, versionJson);
}

main();
